Repository navigation
Decommit memory on cls - #20889
Open
Leonard Hecker (lhecker) wants to merge 2 commits into
Open
Decommit memory on cls#20889Leonard Hecker (lhecker) wants to merge 2 commits into
Leonard Hecker (lhecker) wants to merge 2 commits into
Conversation
Comment on lines
+230
to
+231
| // Several rows may have been reset back to whitespace, akin to a mutation. | ||
| _lastMutationId++; |
Member
Author
There was a problem hiding this comment.
Dustin L. Howett (@DHowett) FYI this is the only difference to the other PR. It's a bug I found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While the changes are complex, they are straightforward,
except for one bit: The complete refactor of
ScrollRows.The reason it became necessary is that moving the viewport to the top
during
ClearScrollbackmay wrap the source range across the buffer'send. VT/conhost scrolling keeps src/dst ranges within logical bounds,
where choosing the copy direction is sufficient.
For instance: Imagine we have physical rows
A B Cand I callScrollRows(2, 2, -2)then this should result inC, A, C.However, the old logic would produce
C C C, because it copies2 (C) -> 0 (A)and then0 (A) -> 1 (B). By the time the 2nd copyruns, the contents of row A have already been overwritten by C.
This is the classic difference between a
memmoveand ascroll array.ScrollRowshas never been an actual scroll function. The name stemsmore from
ScrollConsoleScreenBuffer, which turn refers to historicalbit blit scrolling.
Part of #18290
Validation Steps Performed
cls= memory use 📉